import matplotlib.pyplot as plt

# 利润表数据
profit_statement_data = {
    'Total Operating Revenue': 733962005.41,
    'Total Operating Costs': 1326368528.69,
    'Selling Expenses': 32685342.34,
    'Administrative Expenses': 430652863.08,
    'R&D Expenses': 43762675.18,
    'Financial Expenses': 70446083.68,
    'Net Profit': -926982846.43
}

# 准备数据
labels = list(profit_statement_data.keys())
values = list(profit_statement_data.values())

# 绘制柱状图
plt.figure(figsize=(12, 8))
plt.bar(labels, values, color=['blue' if v > 0 else 'red' for v in values])

# 添加标题和标签
plt.title('Profit Statement Analysis for 2023')
plt.xlabel('Profit Statement Item')
plt.ylabel('Amount (CNY)')

# 显示数值标签
for i, value in enumerate(values):
    plt.text(i, value, f'{value}', ha='center', va='bottom' if value > 0 else 'top')

# 显示图形
plt.show()